<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

/**
 * 删除缓存
 * @author Cuil <lntschampion@163.com>
 * @date 2016-03-23
 */
class Delcache extends CI_Controller {

    private static $keys;

    public function __construct() {
        parent::__construct();
        $this->load->driver('cache');
        self::$keys = config_item('file_key');
    }

    /**
     * 删除缓存
     */
    private function getdel($id, $key) {
        $cache_key = get_cache_key($id, @$key);
        return $this->cache->file->delete($cache_key);
    }

    /**
     * [删作缓存]
     * @author fans
     * @date 2016-8-1
     * */
    public function del() {
        $id = getParam($this->input->get_post('id'), 'int');
        $key = getParam($this->input->get_post('key'), 'string');
        return $this->getdel($id, $key);
    }
     /**
     *删除首页广告位
     */
    public function delscrollpic(){
    $id = getParam($this->input->get_post('id'), 'int');
    $key = getParam($this->input->get_post('key'), 'string');
    return $this->getdel($id,$key);
    }
     /**
     * 删除省份缓存
     */
    public function delregion() {
        $cache_key = get_cache_key('1', self::$keys['citys']);
        $res = $this->cache->file->delete($cache_key);
    }
}
